/*
 * GwtYuiCarousel - API to integrate YUI Carousel in GWT framework
 *
 * Copyright (c) 2007, Nicolas Hoppenot
 *
 * This free software is licensed under the Apache License, Version 2.0 (the "License").
 * To obtain a copy of the licence, visit : http://www.apache.org/licenses/LICENSE-2.0
 *
 * This software is distributed WITHOUT ANY WARRANTY OR CONDITION OF ANY KIND.
 * Please see the license for more information.
 *
 * Version $0.6.1-beta1$
 */
package com.gwtyuicarousel.client.ui;

import com.google.gwt.user.client.Element;

/**
 * This interface define the methods permitting to handle the events fired by the Carousel. To have
 * information of the events fired by Carousel, please the documentation of the javascript component
 * at that address : http://billwscott.com/carousel/
 * 
 * Please note that the indexes are starting from 0, and not 1 like in the javascript API.
 * 
 * @version $0.6.1-beta1$
 * @author Nicolas Hoppenot
 * 
 */
public interface CarouselListener {

  /**
   * Handler "animationCompleteHandler" (set the attribute "animationCompleteHandler" when calling
   * method {@link Carousel#setCarouselListener(CarouselListener)}. For more information about this
   * attribute, please see http://billwscott.com/carousel/#properties.
   */
  void onAnimationComplete(Carousel carousel, Carousel.Direction direction);

  /**
   * Handler "loadInitHandler" (set the attribute "loadInitHandler" when calling
   * method {@link Carousel#setCarouselListener(CarouselListener)}. For more information about this
   * attribute, please see http://billwscott.com/carousel/#properties.
   */
  void onLoadInit(Carousel carousel, int startIndex, int lastIndex, boolean alreadyCached);

  /**
   * Handler "loadNextHandler" (set the attribute "loadNextHandler" when calling
   * method {@link Carousel#setCarouselListener(CarouselListener)}. For more information about this
   * attribute, please see http://billwscott.com/carousel/#properties.
   */
  void onLoadNext(Carousel carousel, int startIndex, int lastIndex, boolean alreadyCached);

  /**
   * Handler "loadPrevHandler" (set the attribute "loadPrevHandler" when calling
   * method {@link Carousel#setCarouselListener(CarouselListener)}. For more information about this
   * attribute, please see http://billwscott.com/carousel/#properties.
   */
  void onLoadPrevious(Carousel carousel, int startIndex, int lastIndex, boolean alreadyCached);

  /**
   * Handler "prevButtonStateHandler" (set the attribute "prevButtonStateHandler" when calling
   * method {@link Carousel#setCarouselListener(CarouselListener)}. For more information about this
   * attribute, please see http://billwscott.com/carousel/#properties.
   */
  void onPrevButtonStateChange(Carousel carousel, Element[] previousElements, boolean enabled);

  /**
   * Handler "nextButtonStateHandler" (set the attribute "nextButtonStateHandler" when calling
   * method {@link Carousel#setCarouselListener(CarouselListener)}. For more information about this
   * attribute, please see http://billwscott.com/carousel/#properties.
   */
  void onNextButtonStateChange(Carousel carousel, Element[] nextElements, boolean enabled);

}
